﻿using System.Collections.Generic;
namespace Smokey.Shared.Constants {
    public class ApplicationStatusConstant : DatabaseConstant {

        public ApplicationStatusConstant(string value, string description)
            : base(value, description) {
        }

        public static readonly ApplicationStatusConstant New = new ApplicationStatusConstant("N", "New");

        public static readonly IEnumerable<ApplicationStatusConstant> All = new List<ApplicationStatusConstant>() {
            New,
        };

        private static readonly IDictionary<string, ApplicationStatusConstant> ValueDictionary =
            new Dictionary<string, ApplicationStatusConstant>() {
            { "N", ApplicationStatusConstant.New } 
       };

        public static ApplicationStatusConstant GetConstantByValue(string value) {
            ApplicationStatusConstant constant;
            value = value.Trim();
            if (ValueDictionary.TryGetValue(value, out constant)) {
                return constant;
            } else {
                return null;
            }
        }
    }
}
